package com.shixi.dao;

import com.shixi.domain.Product;

import java.util.List;

public interface ProductDao {

    /*查询所有商品*/
    List<Product> getAllProduct();

    /*根据用户名查询商品*/
    List<Product> getUserProduct(String goods_username);

    /*根据id查询商品*/
    Product getProductById(int goods_id);

    /*根据url查询商品*/
    Product getProductByUrl(String picurl);

    /*关键字查询商品*/
    List<Product> getMatchingProduct(String matchString);
    List<Product> getMatchingUserProduct(String goods_username,String matchString);

    /*购买更新商品库存*/
    int updateProductCount(int goods_id);

    /*更新商品信息*/
    int updateProductInfo(int goods_id, String goods_name, String goods_des, int goods_count, int goods_price);
    int updareProductInfoRecord(int goods_id, String goods_name, String goods_des, int goods_price);

    /*删除商品*/
    int deleteProductById(int goods_id);

    /*添加商品*/
    int insertProduct(String goods_username, String goods_name, String goods_des, String goods_count, String goods_price, String goods_picurl);
    int insertProductRecord(int goods_id, String username, String goods_name, String goods_des, int goods_price);
}
